Skip to content

Adapt to cat_tools 0.3.0: renamed function, two new object types - #28

Open
jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:cat_tools-0.3.0-fix
Open

Adapt to cat_tools 0.3.0: renamed function, two new object types#28
jnasbyupgrade wants to merge 2 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:cat_tools-0.3.0-fix

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Extracted from #5 ("Switch to pgxn-tools based testing"), which had
scope-crept into carrying this fix alongside the actual CI/pgxn-tools
migration. Splitting it out so it can be reviewed and merged on its own.

Update while preparing this PR: it originally also changed the
Makefile's cat_tools target to build from cat_tools' 0.3.0 git tag
directly, working around PGXN's package index being stuck on the broken,
2017-era 0.2.1 release (column "oid" specified more than once at
CREATE EXTENSION cat_tools). That's no longer true -- PGXN's index now
serves 0.3.0 directly (confirmed against the live index, a clean
CREATE EXTENSION cat_tools locally, and #5's now-green CI, all without
any Makefile change). So this PR no longer touches the Makefile at all;
plain pgxn install --unstable cat_tools already resolves to 0.3.0.

What's left: adapting to cat_tools 0.3.0's real API/enum changes

Because cat_tools has apparently never successfully run against
object_reference's full suite before (whatever version was previously
resolved), this surfaced two small, real fixes:

  • cat_tools.function__arg_types_text() is deprecated in 0.3.0 in favor
    of cat_tools.routine__parse_arg_types_text() (identical
    signature/body, just renamed) and emits a WARNING on every call.
    Switched sql/object_reference.sql's one call site to the
    non-deprecated name.
  • cat_tools 0.3.0's object_type enum grew two new members,
    partitioned table and partitioned index. pg_get_object_address()
    doesn't recognize either (only the base table/index types they
    derive from), so they're classified as unsupported
    (object_reference.unsupported()), matching the existing handling of
    event trigger for the same reason. test/sql/all.sql's sanity-check
    of the unsupported set is updated to match.

sql/object_reference--stable.sql (generated from sql/object_reference.sql)
and test/expected/zzz_build.out are regenerated to match.

Verification

  • CREATE EXTENSION cat_tools; standalone on PostgreSQL 17 via plain
    pgxn install --unstable cat_tools: installs cleanly at 0.3.0.
  • make test on PostgreSQL 17: all 7 tests pass cleanly, zero diffs.
  • test/expected/zzz_build.out's update here is a pure mechanical
    line-number shift (from the added enum-growth comment) plus the
    disappearance of the deprecated-function warning -- matches exactly
    what's already landed and CI-verified on master-pre-rollback (the
    branch Switch to pgxn-tools based testing #5 used to also carry this content on).

No longer anything for #5 to depend on merging first -- #5's CI already
passes cleanly on its own, since PGXN already serves a working cat_tools.
This PR is now a plain correctness/adaptation fix, reviewable and
mergeable independently and in either order relative to #5.

pgxn install --unstable cat_tools resolves to the newest release actually
published to the PGXN package index, which is still 0.2.1 (2017) and fails
standalone on modern PostgreSQL with "column oid specified more than once"
at CREATE EXTENSION. A fixed release, 0.3.0, is tagged in cat_tools' own
git repo but hasn't been uploaded to PGXN yet, so the Makefile's cat_tools
target now clones Postgres-Extensions/cat_tools at the 0.3.0 tag and
builds/installs it directly.

Since this is the first time object_reference's suite has actually run
against a real, working cat_tools, two small fallout fixes are needed:

- cat_tools.function__arg_types_text() is deprecated in 0.3.0 in favor of
  cat_tools.routine__parse_arg_types_text() (identical signature/body,
  just renamed, deprecated one emits a WARNING on every call). Switched
  object_reference's one call site to the non-deprecated name.
- cat_tools 0.3.0's object_type enum grew two new members, "partitioned
  table" and "partitioned index". pg_get_object_address() doesn't
  recognize either (only the base table/index types they derive from),
  so object_reference classifies them as unsupported, matching
  object_reference.unsupported()'s existing handling of "event trigger"
  for the same reason. test/sql/all.sql's sanity-check of the unsupported
  set is updated to match.

sql/object_reference--stable.sql and test/expected/zzz_build.out are
regenerated (make results) to match.

Extracted from PR Postgres-Extensions#5, which had scope-crept into also carrying this fix
alongside the actual CI/pgxn-tools migration; splitting it out here so it
can be reviewed and merged independently.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 953cd7dd-8d02-4c43-80c5-233e507e9db3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jnasbyupgrade added a commit that referenced this pull request Aug 7, 2026
Rebuilt fresh on top of current master, containing only the actual
CI/pgxn-tools migration (the SQL style linter integration and the
cat_tools 0.3.0 dependency fix that had scope-crept into this branch are
split out to #16 and #28 respectively).

- Add .github/workflows/ci.yml: a `changes` job (docs-only gate +
  PG-major-matrix derivation from two constants), a `test` matrix job
  (container: pgxn/pgxn-tools, PostgreSQL 12-18), and an
  `all-checks-passed` aggregation gate for use as a single stable
  required status check.
- Remove .travis.yml and pg-travis-test.sh, superseded by the above.
- test/dump/run.sh: add -X to several psql invocations, disabling
  ~/.psqlrc so test runs are deterministic.
…ls 0.3.0

pgxn install --unstable cat_tools now resolves to cat_tools 0.3.0 directly
(confirmed against the live PGXN index and by a clean CREATE EXTENSION
cat_tools; both locally and, once pushed, in the actual object_reference
CI run for Postgres-Extensions#5's slimmed CI-migration branch -- it went fully green without
this Makefile change at all). The PGXN package index being stuck at the
broken, 2017-era 0.2.1 release was true when this fix was first written,
but isn't true anymore, so the git-clone-from-tag workaround has nothing
left to work around. Keeping it would leave a Makefile comment describing
a problem that no longer exists.

The SQL/test fixes (renamed function call, new object_type enum members
classified as unsupported) are unaffected -- those are needed regardless
of how cat_tools 0.3.0 gets installed.
@jnasbyupgrade jnasbyupgrade changed the title Build cat_tools from its 0.3.0 git tag; adapt to its API/enum changes Adapt to cat_tools 0.3.0: renamed function, two new object types Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant